function AnimacionMar() {
	this.contexto = document.getElementById("canvasBoc").getContext("2d");
	this.posY = 0;
	this.posX = 380
	this.incrementoY = 1;
	this.incrementoX = 10;
	// this.incrementoX = 2;
	var that = this;
	this.progresa = function() {
		this.posY = this.posY + this.incrementoY;
		this.posX = this.posX + this.incrementoX;
		if (this.posY == 40)
			this.incrementoY = -1;
		else if (this.posY == -40)
			this.incrementoY = 1;
		if (this.posX >= 1200)
			this.incrementoX = -10;
		else if (this.posX<=310)
			this.incrementoX = 10;
		this.contexto.clearRect(0,0,800,400);
		this.contexto.fillStyle = "#61f128";
		this.contexto.globalAlpha = .7;
		this.contexto.beginPath();
		this.contexto.moveTo(380, 378);
		// this.contexto.bezierCurveTo(520 + this.posX, 378 - this.posY, 700 + this.posX, 378 + this.posY, 800, 378);
		this.contexto.bezierCurveTo(this.posX, 378 - this.posY, 100 + this.posX, 378 + this.posY, 800, 378);
		this.contexto.lineTo(800, 400);
		this.contexto.lineTo(380,400);
		this.contexto.closePath();
		this.contexto.fill();
		this.contexto.strokeStyle = "#61f4f9";
		this.contexto.stroke();
		//
		this.contexto.fillStyle = "#3df5f3";
		this.contexto.globalAlpha = .6;
		this.contexto.beginPath();
		this.contexto.moveTo(380, 378);
		this.contexto.bezierCurveTo(520, 378 - this.posY, 700, 378 + this.posY, 800, 378);
		this.contexto.lineTo(800, 400);
		this.contexto.lineTo(380,400);
		this.contexto.closePath();
		this.contexto.fill();
		this.contexto.strokeStyle = "#00bff39";
		this.contexto.stroke();
		//
		this.contexto.fillStyle = "#139196";
		this.contexto.globalAlpha = .5;
		this.contexto.beginPath();
		this.contexto.moveTo(380, 378);
		this.contexto.quadraticCurveTo(this.posX, 378 - this.posY, 800, 378);
		this.contexto.lineTo(800, 400);
		this.contexto.lineTo(380,400);
		this.contexto.closePath();
		this.contexto.fill();
		this.contexto.strokeStyle = "white";
		this.contexto.stroke();
		
		//
		setTimeout(function(){that.progresa()}, 33);
	}	
}




window.onload = function() {
	new AnimacionMar().progresa();
}
